package com.member.shop.domain;

import java.net.Inet4Address;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.member.common.annotation.Excel;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.experimental.SuperBuilder;
import com.member.common.core.domain.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 商品浏览统计对象 sys_biz_goods_browse
 *
 * @author lixinchen
 * @date 2025-01-11
 */
@Data
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
@TableName("sys_biz_goods_browse")
public class SysBizGoodsBrowse extends BaseEntity {

    private static final long serialVersionUID = 1L;


    /**
     * 唯一id
     */
    @TableId(type = IdType.AUTO)
    private Long id;


    /**
     * 商品id
     */
    @Excel(name = "商品id")
    private Long goodsId;


    /**
     * 用户id
     */
    @Excel(name = "用户id")
    private Long userId;


    /**
     * 统计类型（0 所有，1 最近30天）
     */
    @Excel(name = "统计类型", readConverterExp = "0,所有，1,最近30天")
    private Integer statType;


    /**
     * 统计开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "统计开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private LocalDate statStartTime;


    /**
     * 统计截止时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "统计截止时间", width = 30, dateFormat = "yyyy-MM-dd")
    private LocalDate statEndTime;
    @TableField(exist = false)
    private SysBizUser user;
    @TableField(exist = false)
    private SysBizGoods goods;

    /**
     * 最新浏览时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "最新浏览时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastBrowseTime;


    /**
     * 浏览次数
     */
    @Excel(name = "浏览次数")
    private Long browseCount;

}
